package com.tuanzi.loan.web.lazy.user;

import com.tuanzi.loan.business.service.user.LoanUserAgreementService;
import com.tuanzi.loan.core.lazy.BaseLazyDataModel;
import com.tuanzi.loan.core.util.SpringContextHolder;
import com.tuanzi.loan.core.vo.PageSearcher;
import com.tuanzi.loan.vo.request.user.LoanUserAgreementSearchRequest;
import com.tuanzi.loan.vo.response.user.LoanUserAgreementResponse;
import org.springframework.data.domain.Page;

/**
 * @Author: chenweijun
 * @Date: 2019/9/25 10:42
 */
public class LoanUserAgreementLazyDataModel extends BaseLazyDataModel<LoanUserAgreementSearchRequest, LoanUserAgreementResponse>{


    private LoanUserAgreementService loanUserAgreementService = SpringContextHolder.getBean(LoanUserAgreementService.class);

    public LoanUserAgreementLazyDataModel(LoanUserAgreementSearchRequest loanUserAgreementSearchRequest) {
        super(loanUserAgreementSearchRequest);
    }

    @Override
    protected Page<LoanUserAgreementResponse> doLoad(PageSearcher<LoanUserAgreementSearchRequest> pageSearcher) {
        return loanUserAgreementService.list(pageSearcher);
    }
}
